/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package abricots.entity.state;

/**
 *
 * @author cghislai
 */
public class ServerEntityState extends BasicEntityState {
   private boolean collision;

   public ServerEntityState() {
   }

   public ServerEntityState(boolean collision, float posX, float posY, float speed, float angle, long gameTime, int entityId) {
      super(posX, posY, speed, angle, gameTime, entityId);
      this.collision = collision;
   }

   public boolean isCollision() {
      return collision;
   }

   public void setCollision(boolean collision) {
      this.collision = collision;
   }

   @Override
   public Object clone() throws CloneNotSupportedException {
      return new ServerEntityState(collision, posX, posY, speed, angle, gameTime, entityId);
   }

   @Override
   public boolean equalsRegardlessOfTime(EntityState o) {
      if (!super.equalsRegardlessOfTime(o)) {
         return false;
      }
      ServerEntityState entityState = (ServerEntityState) o;
      if (entityState.isCollision() != collision) {
         return false;
      }
      return true;
   }

   @Override
   public String toString() {
      return "Collision: " + collision + super.toString();
   }
}
